﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for Order
/// </summary>
public partial class Order
{
    public String StatusStr
    {
        get
        {

            string str = "";
            if (SellerConfirm == true && CustomerConfirm == true)
                str = "Đã hoàn thành";
            else if (SellerCancel == true && CustomerCancel == true)
                str = "Đã hủy";
            else if (SellerCancel == true && CustomerCancel != true)
                //str = "Người bán đã hủy";
                str = "Đã hủy";
            else if (SellerCancel != true && CustomerCancel == true)
                //str = "Người mua đã hủy";
                str = "Đã hủy";
            else if (CustomerReject == true && SellerReconfirm == true)
                str = "Đang giao hàng";
            else if (CustomerReject == true)
                str = "Không nhận hàng";
            else if (SellerConfirm == true)
                str = "Đang giao hàng";
            else if (CustomerActive == true && SellerActive == true)
                str = "Đang hoàn thành";
            else
                str = "Đang xử lý";
            return str;
        }
    }
    public String StatusCode
    {
        get
        {
            string str = "";
            if (SellerConfirm == true && CustomerConfirm == true)
                str = "complete";
            else if (SellerCancel == true && CustomerCancel == true)
                str = "cancel";
            else if (SellerCancel == true && CustomerCancel != true)
                str = "sellerCancel";
            else if (SellerCancel != true && CustomerCancel == true)
                str = "buyerCancel";
            else if (CustomerReject == true && SellerReconfirm == true)
                str = "delivery";
            else if (CustomerReject == true)
                str = "inject";
            else if (SellerConfirm == true)
                str = "delivery";
            else if (CustomerActive == true && SellerActive == true)
                str = "incomplete";
            else
                str = "process";
            return str;
        }
    }
}
public partial class OrderComment
{
    public String idAccStr
    {
        get
        {
            return idAcc.HasValue ? idAcc.ToString() : "none";

        }
    }
}
public partial class Gig
{
    public string CssClass { get; set; }
    public string TrangthaiGig
    {
        get
        {
            string Trangthai2 = "";
            if (TrangThai == 0)
                Trangthai2 = "Mới tạo";
            else if (TrangThai == 1)
                Trangthai2 = "Không Hợp Lệ";
            else if (TrangThai == 2)
                Trangthai2 = "Đang Ẩn";
            else if (TrangThai == 3)
                Trangthai2 = "Đang Hiện";
            return Trangthai2;
        }
    }
    public string DaDangVideo
    {
        get
        {
            string tt = "";
            if (String.IsNullOrEmpty(LinkVideo))
            {
                tt = "not";
            }
            else
                tt = "yes";
            return tt;
        }
    }
}
public partial class VLGAccount
{
    public string QuocGia
    {
        get
        {
            string Quocgia = "";
            string[] ipArr = ipAddress.Split('.');
            int w = int.Parse(ipArr[0].ToString());
            int x = int.Parse(ipArr[1].ToString());
            int y = int.Parse(ipArr[2].ToString());
            int z = int.Parse(ipArr[3].ToString());
            int IpNumber = 16777216 * w + 65536 * x + 256 * y + z;

            return Quocgia;
        }
    }
}

//lay doi tuong ve linq bao loi --> tao class de ko bi loi cua linq
public class CollectionJson
{
    public CollectionJson()
    {

    }
    public string Name { get; set; }
    public string TimeInput { get; set; }
    public int Id { get; set; }
    public string CssClass { get; set; }
}
public partial class GigRequest
{
    public string StatusStr
    {
        get
        {
            return IsActive.HasValue ? IsActive.Value == true ? "Đã duyệt" : "Không duyệt" : "Đang chờ duyệt";
        }
    }
}